<?php
// 获取图书的信息；
$data = json_decode( file_get_contents("./data.txt") ,true);
// print_r($data);
// echo 111;



?>


<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/booksList1.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
	</head>
	<body>
		<div class="content">
			<ul class="box-con"> 
			<?php foreach($data as $v){ ?>
				<li>
					<a href="#">
						<img style="width:120px" src="<?php echo $v['imgUrl']; ?>" alt="" />	
						<p class="book-name"><?php echo $v['bookName']; ?></p>
						<p class="price">￥<?php echo $v['price']; ?></span></p>
					</a>
					<button>立即购买</button>
				</li>
				
				<?php } ?>
				<!-- <li>
					<a href="#">
						<img src="./img/181005_106.jpg" alt="" />	
						<p class="book-name">书名</p>
						<p class="price">￥20</span></p>
					
					</a>
					<button>立即购买</button>
				</li>
				<li>
					<a href="#">
						<img src="./img/181005_106.jpg" alt="" />	
						<p class="book-name">书名</p>
						<p class="price">￥20</span></p>
					
					</a>
					<button>立即购买</button>
				</li>
				<li>
					<a href="#">
						<img src="./img/181005_106.jpg" alt="" />	
						<p class="book-name">书名</p>
						<p class="price">￥20</span></p>
					
					</a>
					<button>立即购买</button>
				</li>
				<li>
					<a href="#">
						<img src="./img/181005_106.jpg" alt="" />	
						<p class="book-name">书名</p>
						<p class="price">￥20</span></p>
					
					</a>
					<button>立即购买</button>
				</li>
				<li>
					<a href="#">
						<img src="./img/181005_106.jpg" alt="" />	
						<p class="book-name">书名</p>
						<p class="price">￥20</span></p>
					
					</a>
					<button>立即购买</button>
				</li> -->
				
			</ul>
			<div class="pages">
				<button class="btn after">上一页</button>
				
					<span class="active">1</span>	
				
				<button class="btn befor">下一页</button>
			</div>
		</div>
	</body>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script type="text/javascript" src="js/booksList.js"></script>
</html>